<?php

/**
 * Product form base class.
 *
 * @package    product
 * @subpackage form
 * @author     Your name here
 * @version    SVN: $Id: sfPropelFormGeneratedTemplate.php 12815 2008-11-09 10:43:58Z fabien $
 */
class BaseProductForm extends BaseFormPropel
{
  public function setup()
  {
    $this->setWidgets(array(
      'id'          => new sfWidgetFormInputHidden(),
      'title'       => new sfWidgetFormInput(),
      'category'    => new sfWidgetFormInput(),
      'city'        => new sfWidgetFormInput(),
      'lot_no'      => new sfWidgetFormInput(),
      'product_img' => new sfWidgetFormInput(),
      'specs'       => new sfWidgetFormInput(),
      'params'      => new sfWidgetFormTextarea(),
      'fprice'      => new sfWidgetFormInput(),
      'sprice'      => new sfWidgetFormInput(),
      'date_c'      => new sfWidgetFormDateTime(),
    ));

    $this->setValidators(array(
      'id'          => new sfValidatorPropelChoice(array('model' => 'Product', 'column' => 'id', 'required' => false)),
      'title'       => new sfValidatorString(array('max_length' => 255)),
      'category'    => new sfValidatorInteger(),
      'city'        => new sfValidatorString(array('max_length' => 32)),
      'lot_no'      => new sfValidatorString(array('max_length' => 128)),
      'product_img' => new sfValidatorString(array('max_length' => 128)),
      'specs'       => new sfValidatorString(array('max_length' => 128)),
      'params'      => new sfValidatorString(),
      'fprice'      => new sfValidatorString(array('max_length' => 128)),
      'sprice'      => new sfValidatorNumber(),
      'date_c'      => new sfValidatorDateTime(),
    ));

    $this->widgetSchema->setNameFormat('product[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    parent::setup();
  }

  public function getModelName()
  {
    return 'Product';
  }


}
